<HTML>
	<TITLE>Workflow.NET<%#actionname%>-<%#propertyname%></TITLE>
	<STYLE>
	<%#stylesheet%>
	.N-ListBGCOLORCOL1
	{
	    BACKGROUND-COLOR: #e9e9e9
	}
	.N-ListBGCOLORCOL2
	{
	    BACKGROUND-COLOR: #f5f4f4
	}
	tdwork {
		font-family: Verdana, Arial;
		font-size: 10px;
	}
	.titlework {
		font-family: Verdana, Arial;
		font-size: 11px;
		font-weight: bold;
	}
	.input-buttonswork {
		font-family: Verdana, Arial;
		font-size: 11px;
		border: 1px inset #447392;
		color: #2A3B66;
		height: 21px;
		width:auto;
		background-image:url(<%#VirtualDirectory%>/images/button-bg.gif);
    }
	.style1 {color: #FFFFFF}
    </STYLE>
	<BODY  MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0" onload="checktoselect()" scroll="no" >
		<FORM name=wf_theform method="post" ID="Form1">
			<TABLE align="center" border="0" cellspacing="1" cellpadding="2" width="100%" ID="Table1" bgcolor="#447392">
				<tr bgcolor="#C4D2FB">
				   <td background="<%#VirtualDirectory%>/images/bg.jpg" bgcolor="#C4D2FB" class="titlework style1" height="24">Adding for Work Action With General View </td>
				</tr>
				<tr bgcolor="#FFFFFF">
								    <td>
								    <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#447392">

								        <tr bgcolor="#FFFFFF">
								          <td height="45" bgcolor="#E7EFFE">File Name:</td>
								          <td bgcolor="#F6F7F7"><SELECT class=list id="SelTempName" name="SelTempName" onChange="Checkvalidate()">
											<%#filenames%>
										</SELECT></td>
								        </tr>
								        <tr bgcolor="#FFFFFF">
								          <td bgcolor="#E7EFFE">* GroupUI File Name:</td>
								          <td bgcolor="#F6F7F7"><SELECT class=list id="SelGroupUIName" name="SelGroupUIName">
											<%#GroupUIfilenames%>
										</SELECT></td>
								        </tr>
								        <tr align="center" bgcolor="#FFFFFF">
								          <td colspan="2" bgcolor="#84B1CF">
								          <input type="radio" name="radActionOutput" onclick="javascript:DisplaydivActionOutput()">
								            Action Outputs
								            <input type="radio" name="radInput" onclick="javascript:DisplaydivInputVariables()">
								            Input Variables
								            <input type="radio" name="radOutput" onclick="javascript:DisplaydivOutputVariables()">
								            Output Variables </td>
								        </tr>

								        <TR valign="top" bgcolor="#FFFFFF">
											<TD colspan=4 bgcolor="#FFFFFF" width="100%">&nbsp;

												<div id="divActionOutput" style="display:none;height:400;width=600;overflow:auto">
													<%#ActionOutputDetails%>
												</div>
												<div id="divInputVariables" style="display:none;height:400;width=600;overflow:auto">
													<%#InputVariableDetails%>
												</div>
												<div id="divOutputVariables" style="display:none;height:400;width=610;overflow:auto">
													<%#OutputVariableDetails%>
												</div>

											</TD>
										</TR>
										<TR bgcolor="#FFFFFF">
											<TD align="left" colspan=4 bgcolor="#E7EFFE">
												* GroupUI File Name : This template will be used for displaying to the participants when GroupUI is enabled in the
		    									activitylist control.
		    									GroupUI(Used to display when participant want to act on multiple activities)
											</TD>
										</TR>

										<TR bgcolor="#FFFFFF">
											<TD align="left" colspan=4 id="TDSave" bgcolor="#E7EFFE">
												To Set the value for Action Outputs,Input Variables,Output Variables
												Click on the radio button,provide the values and click on the Save button below.
											</TD>
										</TR>

										<TR valign="top" bgcolor="#FFFFFF">

											<TD colspan=4 align="right" bgcolor="#ffffff">
												<!--<input type="button" class="input-buttonswork"  name="btnModify" value="Update" onclick="saveForm()">&nbsp;&nbsp;-->
												<input type="button" class="input-buttonswork"  name="btnSave" value="Save" onclick="saveForm()">
												<input type="button" class="input-buttonswork"  name="btnClose" value="Close" onclick="javascript:window.close()">
											</TD>
										 </TR>
										 <tr>
										 	<td colspan=4 bgcolor="#6A98BB" height="24"></td>
										</tr>
								      </table>
									 </td>
										</tr>
									<input type="hidden" name="hidlistcount" value="<%#listcount%>">
									<input type="hidden" name="hidinputtxtboxcount" value="<%#inputtxtboxcnt%>">
									<input type="hidden" name="hidinputdropdowncount" value="<%#inputdropdowncnt%>">
									<input type="hidden" name="hidfieldcollectioncount" value="<%#Fieldcollectioncount%>">
									<input type="hidden" name="hidoutputcount" value="<%#outputtxtboxcnt%>">
									<input type="hidden" name="_hidtempstore" id="_hidtempstore" value="<%#hidtempstore%>">
									<input type="hidden" name="_mode" ID="_mode">
									<input type="hidden" name="_pageinfo" id="_pageinfo">
									<input type="hidden" name="hidrolemode" id="hidrolemode" value="<%#hidrolemode%>">
								</FORM>
		<script language=javascript>

			//This is to show the buttons based on Add mode or edit mode

				/*if(document.wf_theform.hidfieldcollectioncount.value==0)
				{

					document.wf_theform.btnModify.style.display='none';
					document.getElementById("TDModify").innerText='';
				}
				else if(document.wf_theform.hidfieldcollectioncount.value>0)
				{

					document.wf_theform.btnSave.style.display='none';
					document.getElementById("TDSave").innerText='';

				}
				else if(document.wf_theform._hidtempstore.value=="")
				{
					document.getElementById("TDModify").innerText='';
				}*/


			//For displaying the dropdown and changing the values
				var valuepropertydiv = "<SELECT id='valueinput' class=list>";
				valuepropertydiv += "<%#assignvalue%>";
				valuepropertydiv +=	"</SELECT>";


				var varpropertydiv = "<SELECT id='valueinput' class=list>";
				varpropertydiv += "<%#assignvariables%>"
				varpropertydiv += "</SELECT>";


				var contentpropertydiv = "<SELECT id='valueinput' class=list>";
				contentpropertydiv +=  "<%#assigncontent%>";
				contentpropertydiv +=  "</SELECT>";

				var valuediv= "<input type=textbox id='valueinput' class='inputs' >";

			//For displaying the dropdown and changing the values

				//For changing the div on selection of dropdown
				function changeDiv( divvar,divname )
				{
					var oexpr2;
					if( !oexpr2 )
						oexpr2 = document.getElementsByTagName("div")[divname];
						oexpr2.innerHTML = eval(divvar);

				}

				function Select_onclick(selectname,divname)
				{

					var oselect3 = document.getElementsByTagName("select")[selectname];

					switch(oselect3.value)
					{

						case "value": changeDiv("valuediv",divname);
						break;
						case "valueproperty": changeDiv("valuepropertydiv",divname);
						break;
						case "varproperty": changeDiv("varpropertydiv", divname);
						break;
						case "dateproperty": changeDiv("datepropertydiv", divname);
						break;
						case "contentproperty": changeDiv("contentpropertydiv", divname);
						break;

						default: changeDiv("valuediv",divname);
						break;

					}

					return false;
				}


				var val="";

				function DisplaydivActionOutput()
				{
				  val=document.wf_theform.SelTempName.value;
				  val=val+"$"+"ActionOutputs";
				  document.wf_theform._mode.value='wrload';
				  document.wf_theform._hidtempstore.value=val;
				  document.wf_theform.submit();
				}
				function DisplaydivInputVariables()
				{
				  val=document.wf_theform.SelTempName.value;
				  val=val+"$"+"InputVariables";
				  document.wf_theform._mode.value='wrload';
				  document.wf_theform._hidtempstore.value=val;
				  document.wf_theform.submit();

				}
				function DisplaydivOutputVariables()
				{
				  val=document.wf_theform.SelTempName.value;
				  val=val+"$"+"OutputVariables";
 	  			  document.wf_theform._mode.value='wrload';
  				  document.wf_theform._hidtempstore.value=val;
				  document.wf_theform.submit();
				}

				function checktoselect()
				{


					var Fldcollectioncnt=document.wf_theform.hidfieldcollectioncount.value;


					var arrhidtempstore="";
					  if(document.wf_theform._hidtempstore.value !="")
						{
							arrhidtempstore=document.wf_theform._hidtempstore.value.split("$");
						}

					  if(Fldcollectioncnt==0 && arrhidtempstore =="NotRoleBased" )
					  {
					  	//For Resizing the Windows
				 		self.resizeTo(720,320);
					  }


					if(arrhidtempstore.length >0 && Fldcollectioncnt==0)
					{
						if(arrhidtempstore !="NotRoleBased")
						{
							//For Resizing the Windows
					 		self.resizeTo(720,710);
						}

						var Fieldtype=arrhidtempstore[1];

						if(Fieldtype=="ActionOutputs")
						{
							document.wf_theform.radActionOutput.checked="true";
							document.getElementById("divActionOutput").style.display='block';

						}
						else if(Fieldtype=="InputVariables")
						{
							document.wf_theform.radInput.checked="true";
							document.getElementById("divInputVariables").style.display='block';
							var listCount=document.wf_theform.hidinputtxtboxcount.value;
							for(i=0;i<listCount;i++)
							{
								Select_onclick('SelectInputVar'+i,'expr'+i);
							}

							//Set the selected values
							for ( i = 0 ;i<parseInt(listCount);i++)
							{
								if(parseInt(listCount) ==1)
									var tempObj = eval("document.wf_theform.valueinput");
								else
									var tempObj = eval("document.wf_theform.valueinput["+i+"]");

								if(typeof(tempObj) == "undefined")
									tempObj = eval("document.wf_theform.valueinput");
								tempObj.value = eval("document.wf_theform.txtinputvarval"+i+".value")

							}

						}
						else if(Fieldtype=="OutputVariables")
						{

							document.wf_theform.radOutput.checked="true";
							document.getElementById("divOutputVariables").style.display='block';
							var listCount=document.wf_theform.hidlistcount.value;

							for(i=0;i<listCount;i++)
							{
								Select_onclick('SelectOutputVar'+i,'expr'+i);
							}

							//Set the selected values
								for ( i = 0 ;i<parseInt(listCount);i++)
								{
									if(parseInt(listCount) ==1)
										var tempObj = eval("document.wf_theform.valueinput");
									else
										var tempObj = eval("document.wf_theform.valueinput["+i+"]");
									if(typeof(tempObj) == "undefined")
										tempObj = eval("document.wf_theform.valueinput");
										if(eval("document.wf_theform.txtoutputvarval"+i+".value") !="")
										tempObj.value = eval("document.wf_theform.txtoutputvarval"+i+".value")

								}

						}


					 }

					 else if(arrhidtempstore.length >0 && Fldcollectioncnt>0)
					  {
								var Fieldtype=arrhidtempstore[1];

								if(Fieldtype=="ActionOutputs")
								{
									document.wf_theform.radActionOutput.checked="true";
									document.getElementById("divActionOutput").style.display='block';
								}
								else if(Fieldtype=="InputVariables")
								{
									document.wf_theform.radInput.checked="true";
									document.getElementById("divInputVariables").style.display='block';
									var listCount=document.wf_theform.hidinputtxtboxcount.value;
									for(i=0;i<listCount;i++)
									{
										Select_onclick('SelectInputVar'+i,'exprIpVar'+i);
									}

									//Set the selected values
									for ( i = 0 ;i<parseInt(listCount);i++)
									{
										if(parseInt(listCount) ==1)
											var tempObj = eval("document.wf_theform.valueinput");
										else
											var tempObj = eval("document.wf_theform.valueinput["+i+"]");

										if(typeof(tempObj) == "undefined")
											tempObj = eval("document.wf_theform.valueinput");
										tempObj.value = eval("document.wf_theform.txtinputvarval"+i+".value")

									}

								}
								else if(Fieldtype=="OutputVariables")
								{
									document.wf_theform.radOutput.checked="true";
									document.getElementById("divOutputVariables").style.display='block';
									var listCount=document.wf_theform.hidoutputcount.value;
									for(i=0;i<listCount;i++)
									{
										Select_onclick('SelectOutputVar'+i,'expr'+i);
									}

									//Set the selected values
									for ( i = 0 ;i<parseInt(listCount);i++)
									{
										if(parseInt(listCount) ==1)
											var tempObj = eval("document.wf_theform.valueinput");
										else
											var tempObj = eval("document.wf_theform.valueinput["+i+"]");
										if(typeof(tempObj) == "undefined")
											tempObj = eval("document.wf_theform.valueinput");
											tempObj.value = eval("document.wf_theform.txtoutputvarval"+i+".value")

									}

								}

						  //For Resizing the Windows
						  	self.moveTo(0,0);
					 		self.resizeTo(720,710);
					 }
					else if(arrhidtempstore.length==0 && Fldcollectioncnt>0)
					{

						 document.wf_theform.radActionOutput.checked="true";
						 document.getElementById("divActionOutput").style.display='block';

						 //For Resizing the Windows
						 	self.moveTo(0,0);
					 		self.resizeTo(720,710);
					 }



				}

				function getselectedvalues()
				{
					var CheckradType="";
					var returnvalue="";
					var i=0;
					var Actionoutputname="";
					var Actionoutputvalue="";
					var ActionoutputCM="";
					var Inputvarname="";
					var Inputvarvalue="";
					var Outputvarname="";
					var Outputvarvalue="";
					var Outputvaroptype="";
					var tempobj;



					//Setting the type on selection of radio buttons

					if(document.wf_theform.radActionOutput.checked)
					{
						CheckradType="AO";
					}
					if(document.wf_theform.radInput.checked)
					{

						CheckradType="I";

					}
					if(document.wf_theform.radOutput.checked)
					{

						CheckradType="O";

					}

					//getting the values and assigning to hidden variable

					if(CheckradType !="")
					{
						var lstCnt=document.wf_theform.hidlistcount.value;

						 if(CheckradType=="AO")
						 {
							for ( i = 0 ;i<parseInt(lstCnt);i++)
							{
								Actionoutputname=eval("document.wf_theform.txtActoutput"+i);
								Actionoutputvalue=eval("document.wf_theform.txtActoutputvalue"+i);
								ActionoutputCM=eval("document.wf_theform.SelectCM"+i);
								if(Actionoutputvalue.value !="")
								{
									if(returnvalue=="")
									{
										returnvalue=Actionoutputname.value+","+Actionoutputvalue.value+","+ActionoutputCM.value;
									}
									else
									{
										returnvalue+="#"+Actionoutputname.value+","+Actionoutputvalue.value+","+ActionoutputCM.value;
									}
								 }
							}
						  }
						//Checking and getting values for input variable selection
						 if(CheckradType=="I")
						   {
						     var inplstcnt=document.wf_theform.hidinputtxtboxcount.value;
						     var inpdropdowncnt=document.wf_theform.hidinputdropdowncount.value;

							  for ( i = 0 ;i<parseInt(inplstcnt);i++)
								{
									Inputvarname=eval("document.wf_theform.txtinputvar"+i);
		  							 if(parseInt(inplstcnt)==1)
										{
											Inputvarvalue = eval("document.wf_theform.valueinput.value");
										}
									 else
										 {
											tempobj=eval("document.wf_theform.valueinput["+i+"]")
											Inputvarvalue=tempobj.value;
										 }
									if(Inputvarvalue !="")
										{
											if(returnvalue=="")
											{
												returnvalue=Inputvarname.value+";"+Inputvarvalue;
											}
											else
											{
												returnvalue+="#"+Inputvarname.value+";"+Inputvarvalue;
											}
										 }
								  }

								 for ( i = 0 ;i<parseInt(inpdropdowncnt);i++)
									{
										Inputvarname=eval("document.wf_theform.txtselinputvar"+i);

										tempobj=eval("document.wf_theform.SelectInput"+i)
										Inputvarvalue=tempobj.value;

										if(Inputvarvalue !="")
											{
												if(returnvalue=="")
												{
													returnvalue=Inputvarname.value+";"+Inputvarvalue;
												}
												else
												{
													returnvalue+="#"+Inputvarname.value+";"+Inputvarvalue;
												}
											 }
								  }

							 }

							//Checking and getting values for output variable selection
							if(CheckradType=="O")
							 {
							 	var outlstcnt=document.wf_theform.hidoutputcount.value;
								for ( i = 0 ;i<parseInt(outlstcnt);i++)
									{
										Outputvarname=eval("document.wf_theform.txtoutputvar"+i);
										Outputvaroptype=eval("document.wf_theform.SelectOPType"+i);
										 if(parseInt(outlstcnt)==1)
											{
												Outputvarvalue= eval("document.wf_theform.valueinput.value");
											}
										 else
										 {
											tempobj=eval("document.wf_theform.valueinput["+i+"]")
											Outputvarvalue=tempobj.value;
										 }


										if(Outputvarvalue  !="")
										{
											if(returnvalue=="")
											{
												returnvalue=Outputvarname.value+","+Outputvarvalue+","+Outputvaroptype.value;
											}
											else
											{
												returnvalue+="#"+Outputvarname.value+","+Outputvarvalue+","+Outputvaroptype.value;
											}
										 }
									 }
							  }

					}
					return 	returnvalue;

				 }

				 function saveForm()
				 {

					//Checking for selection of radio buttons

					if((!document.wf_theform.radActionOutput.checked)&&(!document.wf_theform.radInput.checked)&&(!document.wf_theform.radOutput.checked))
					{
							alert('Please select the radio button to proceed.');
							return false;

					}
					var returnvalue=getselectedvalues();


					if(returnvalue.length==0)
					{
						alert('Please enter the values and proceed');
						return false;
					}

					 var hidval=document.wf_theform._hidtempstore.value;
					 if (hidval=="")
					 {
					 	val=document.wf_theform.SelTempName.value;
					 	if(document.wf_theform.radActionOutput.checked)
					 	{
					 		val=val+"$"+"ActionOutputs";
						 	hidval=val;
						}

						else if(document.wf_theform.radInput.checked)
						{
							val=val+"$"+"InputVariables";
						 	hidval=val;

						}

						else if(document.wf_theform.radOutput.checked)
						{
							val=val+"$"+"OutputVariables";
						 	hidval=val;

						}


					 }
					 document.wf_theform._mode.value='save';
					 document.wf_theform._hidtempstore.value=hidval+"~"+returnvalue;
					 document.wf_theform.submit();

				 }

				 function Checkvalidate()
				 {
				 	alert('Please select the radio button to proceed.');
					return false;
				 }


		</script>
	</BODY>
</HTML>